[#-- freemarker page demo --]
<style type="text/css">
	.page-table {
		margin: 0;
		margin-top: -26px;
		padding: 0;
		font-family: Times, TimesNR, 'New Century Schoolbook', Georgia,'New York', serif;
		text-align: center;
		width:97%;
		font-size:13px;
	}
	
	.page-td {
	 	float: left;
	}
	
	.page-td-p {
		background: none repeat scroll 0 0 #FFFFFF;
	    border: 1px solid #DCDDDD;
	    color: #1E50A2;
	    display: inline-table;
	    margin: 5px 3px 0 0;
	    padding: 4px 5px 0;
	    text-align: center;
	    /*垂直居中*/
	    height: 16px;
	    line-height: 16px;
	    /*去掉下划线*/
	   text-decoration: none;
	}
	
	.page-td a:hover {
		background: none repeat scroll 0 0 #1F3A87;
	    /*border: 1px solid #DCDDDD;*/
	    border: 1px solid #1F3A87;
	    color: #FFFFFF;
	    /*font-weight: bold;*/
	    text-align: center;
	    text-decoration: underline;
	}
	
	.page-selected {
		background: none repeat scroll 0 0 #1F3A87;
	    border: 1px solid #DCDDDD;
	    color: #FFFFFF;
	    font-weight: bold;
	    text-align: center;
	}
	
	.page-disable {
		cursor: default;
	}
	
</style>
[#-- --]
[#if pageSupport ??]
 [#assign x=(pageSupport.getTotalPage())!1 /]
 [#assign y=pageSupport.getCurrentPage() /]
 [#assign z=(page.pageSupport.getPageSize())!1 /]
 [#assign renderTo=(table.renderTo)!'' /]
 	<script type="text/javascript">//<![CDATA[
		// ajax分页：
		[#if ajax==true]
		var baseTable = (function(){
			function _addEventListeners() {
				$('a[page]').unbind('click').click(function() {
					var page = $(this).attr('page');
					$.get(baseTable.config.url, {'ajax':true, 'piece':true, 'currentPage':page}, function(data){
						//
						$(baseTable.config.renderTo).html(data);
						_addEventListeners();
						//
					})
				})
			}
			return {
				 config: {
                	url : null,
                	renderTo: null,
                    theme: null
                },
                init: function () {
                    _addEventListeners();
                }
			}
		}());
		$(function() {
			//var parent = $('#${table.id}').parent().html();
			baseTable.config.url = "${page.url}" ;
			baseTable.config.theme = '';
			baseTable.config.renderTo= "${renderTo!'#articleList'}";
			baseTable.init();
		})
		[/#if]
		//]]>
	</script>
	
[/#if]
<table id="${table.id}" class="table">
	[#if x lte 0]
		[#assign x=1]
	[/#if]
	[#if (table.columnList) ?? ]
		<thead>
			[#list table.columnList as head]
				<th class="${head.headerClass!''}">${head.title}</th>
			[/#list]
		</thead>
		<tbody>
			[#--[#assign blank=z/]--]
			[#list table.source as target]
				<tr>
					[#list table.columnList as column]
							[#if column.innerHtml?? ]
								<td class="${column.columnClass}" [#if column.property ??]tval="${displayer.property("[${target_index}].${column.property}", "")}"[/#if] >
									${column.innerHtml}
								</td>
							[#else]
								<td class="${column.columnClass}">
									${displayer.property("[${target_index}].${column.property}", "${column.format}")}
								</td>
							[/#if]
					[/#list]
				</tr>
				[#--[#assign blank=z-target_index> --]
			[/#list]
			[#-- 不足分页内容,补齐空白行
			[#list 1..blank as t]
				<tr>
					[#list table.columnList as column]
						<td class="${column.columnClass}">
							&nbsp;
						</td>
					[/#list]
				</tr>
			[/#list] --]
		</tbody>
	[/#if]
</table>
[#if pageSupport ??]
<table class="page-table" align="center" id='${pageId}'>
	<tr>
		<td class="page-td">
			[#if pageSupport.isFirst() ]
				<span class="page-td-p page-disable">[#--上一页--]${displayer.getMessage("page.previous")}</span>
			[#else]
				<a class="page-td-p" target="${page.target}" page="${y-1}" [#if ajax==true]href="javascript:void(0);"[#else]href="${page.getPageUrl(y-1)}"[/#if]>${displayer.getMessage("page.previous")}</a>
			[/#if]
			[#list 1..x as i]
		 		[#if i == y]
		 			<span class="page-td-p page-selected">${i}</span>
		 		[#else]
		 			<a class="page-td-p" target="${page.target}" page="${i}" [#if ajax==true]href="javascript:void(0);"[#else]href="${page.getPageUrl(i)}"[/#if]>${i}</a>
		 		[/#if]
		 	[/#list]
			[#if pageSupport.isLast()]
			 	<span class="page-td-p page-disable">${displayer.getMessage("page.next")}</span>
			[#else]
			 	<a class="page-td-p" target="${page.target}" class="s1" page="${y+1}" [#if ajax==true]href="javascript:void(0);"[#else]href="${page.getPageUrl(y+1)}"[/#if]>[#--下一页--]${displayer.getMessage("page.next")}</a>
			[/#if]
			[#--<a style="width:100px;" class="s1" target="_self" href="">在本页阅读全文</a>--]
			<span class="page-td-p page-disable">共${x}页</span>
			<div class="clear"></div>
		</td>
	</tr>
</table>
[/#if]